package cn.edu.hbvtc.qms.domain;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

@Entity
@Table(name = "clazz")
public class Clazz implements Serializable {

	private static final long serialVersionUID = 1L;
	private int id;
	private String clazzId;// 班级号
	private String clazzName;// 班级名称
	private Major major;// 所属专业
	private Set<ClazzArrangement> clazzArrangement;// 班级课程安排
	private int stuNumber;// 学生人数

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column
	public String getClazzId() {
		return clazzId;
	}

	public void setClazzId(String clazzId) {
		this.clazzId = clazzId;
	}

	@Column
	public String getClazzName() {
		return clazzName;
	}

	public void setClazzName(String clazzName) {
		this.clazzName = clazzName;
	}

	@ManyToOne
	@JoinColumn(name = "major_id")
	public Major getMajor() {
		return major;
	}

	public void setMajor(Major major) {
		this.major = major;
	}

	@OneToMany(mappedBy = "clazz")
	@OrderBy("course")
	public Set<ClazzArrangement> getClazzArrangement() {
		return clazzArrangement;
	}

	public void setClazzArrangement(Set<ClazzArrangement> clazzArrangement) {
		this.clazzArrangement = clazzArrangement;
	}

	@Column
	public int getStuNumber() {
		return stuNumber;
	}

	public void setStuNumber(int stuNumber) {
		this.stuNumber = stuNumber;
	}
	
}
